package com.lch.dubboclient;

import com.lch.bean.IHelloService;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: liuchenhui
 * @create: 2020-01-30 12:30
 **/
@RestController
public class DubboController {

    @DubboReference(timeout = 1, cluster = "failfast", mock = "com.lch.dubboclient.SayHelloServiceMock")
    IHelloService helloService;

    @GetMapping("/dubbo")
    public String sayHello() {
        helloService.sayHello();
        return "success";
    }
}
